<?php

/**
 * Input3hour form base class.
 *
 * @method Input3hour getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInput3hourForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'ISTATION_ID'          => new sfWidgetFormInputHidden(),
      'DTTIME'               => new sfWidgetFormInputHidden(),
      'X01'                  => new sfWidgetFormInputText(),
      'X02'                  => new sfWidgetFormInputText(),
      'E11'                  => new sfWidgetFormInputText(),
      'E12'                  => new sfWidgetFormInputText(),
      'E24'                  => new sfWidgetFormInputText(),
      'E25'                  => new sfWidgetFormInputText(),
      'E26'                  => new sfWidgetFormInputText(),
      'E31'                  => new sfWidgetFormInputText(),
      'E32'                  => new sfWidgetFormInputText(),
      'E41'                  => new sfWidgetFormInputText(),
      'E51'                  => new sfWidgetFormInputText(),
      'E61'                  => new sfWidgetFormInputText(),
      'E62'                  => new sfWidgetFormInputText(),
      'E81'                  => new sfWidgetFormInputText(),
      'E410'                 => new sfWidgetFormInputText(),
      'E501'                 => new sfWidgetFormInputText(),
      'SCURRENT_PHENOMENON'  => new sfWidgetFormInputText(),
      'SMSP_PHENOMENON'      => new sfWidgetFormInputText(),
      'SLSP_PHENOMENON'      => new sfWidgetFormInputText(),
      'BTSEND_NEWS'          => new sfWidgetFormInputText(),
      'SNEWS'                => new sfWidgetFormInputText(),
      'DTSAVE_TIME'          => new sfWidgetFormDateTime(),
      'SLOW_CLOUD_TYPE1'     => new sfWidgetFormInputText(),
      'NLOW_CLOUD_NUMBER1'   => new sfWidgetFormInputText(),
      'NLOW_CLOUD_HEIGHT1'   => new sfWidgetFormInputText(),
      'SLOW_CLOUD_TYPE2'     => new sfWidgetFormInputText(),
      'NLOW_CLOUD_NUMBER2'   => new sfWidgetFormInputText(),
      'NLOW_CLOUD_HEIGHT2'   => new sfWidgetFormInputText(),
      'SMIDDLE_CLOUD_TYPE'   => new sfWidgetFormInputText(),
      'NMIDDLE_CLOUD_NUMBER' => new sfWidgetFormInputText(),
      'SHIGH_CLOUD_TYPE'     => new sfWidgetFormInputText(),
      'NHIGH_CLOUD_NUMBER'   => new sfWidgetFormInputText(),
      'NRAINFALL_24HOURS'    => new sfWidgetFormInputText(),
      'E21'                  => new sfWidgetFormInputText(),
      'E22'                  => new sfWidgetFormInputText(),
      'E301'                 => new sfWidgetFormInputText(),
      'NBARO_PRESSURE'       => new sfWidgetFormInputText(),
      'NRAINFALL_6HOURS'     => new sfWidgetFormInputText(),
      'SNH'                  => new sfWidgetFormInputText(),
      'SCL'                  => new sfWidgetFormInputText(),
      'STR'                  => new sfWidgetFormInputText(),
      'SNEWS_NOTE'           => new sfWidgetFormInputText(),
      'NRAINFALL_MIDNIGHT'   => new sfWidgetFormInputText(),
      'E401'                 => new sfWidgetFormInputText(),
      'E402'                 => new sfWidgetFormInputText(),
      'E403'                 => new sfWidgetFormInputText(),
      'E404'                 => new sfWidgetFormInputText(),
      'E405'                 => new sfWidgetFormInputText(),
      'E406'                 => new sfWidgetFormInputText(),
      'NNH'                  => new sfWidgetFormInputText(),
      'E42'                  => new sfWidgetFormInputText(),
      'DTCREATE_TIME'        => new sfWidgetFormDateTime(),
      'IUSER_ID'             => new sfWidgetFormInputText(),
      'SIPADDRESS'           => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'ISTATION_ID'          => new sfValidatorChoice(array('choices' => array($this->getObject()->getIstationId()), 'empty_value' => $this->getObject()->getIstationId(), 'required' => false)),
      'DTTIME'               => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttime()), 'empty_value' => $this->getObject()->getDttime(), 'required' => false)),
      'X01'                  => new sfValidatorNumber(array('required' => false)),
      'X02'                  => new sfValidatorNumber(array('required' => false)),
      'E11'                  => new sfValidatorNumber(array('required' => false)),
      'E12'                  => new sfValidatorNumber(array('required' => false)),
      'E24'                  => new sfValidatorNumber(array('required' => false)),
      'E25'                  => new sfValidatorNumber(array('required' => false)),
      'E26'                  => new sfValidatorNumber(array('required' => false)),
      'E31'                  => new sfValidatorNumber(array('required' => false)),
      'E32'                  => new sfValidatorNumber(array('required' => false)),
      'E41'                  => new sfValidatorNumber(array('required' => false)),
      'E51'                  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'E61'                  => new sfValidatorString(array('max_length' => 3, 'required' => false)),
      'E62'                  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'E81'                  => new sfValidatorNumber(array('required' => false)),
      'E410'                 => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'E501'                 => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SCURRENT_PHENOMENON'  => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'SMSP_PHENOMENON'      => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'SLSP_PHENOMENON'      => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'BTSEND_NEWS'          => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'SNEWS'                => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'DTSAVE_TIME'          => new sfValidatorDateTime(array('required' => false)),
      'SLOW_CLOUD_TYPE1'     => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'NLOW_CLOUD_NUMBER1'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'NLOW_CLOUD_HEIGHT1'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SLOW_CLOUD_TYPE2'     => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'NLOW_CLOUD_NUMBER2'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'NLOW_CLOUD_HEIGHT2'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SMIDDLE_CLOUD_TYPE'   => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'NMIDDLE_CLOUD_NUMBER' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SHIGH_CLOUD_TYPE'     => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'NHIGH_CLOUD_NUMBER'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'NRAINFALL_24HOURS'    => new sfValidatorNumber(array('required' => false)),
      'E21'                  => new sfValidatorNumber(array('required' => false)),
      'E22'                  => new sfValidatorNumber(array('required' => false)),
      'E301'                 => new sfValidatorNumber(array('required' => false)),
      'NBARO_PRESSURE'       => new sfValidatorNumber(array('required' => false)),
      'NRAINFALL_6HOURS'     => new sfValidatorNumber(array('required' => false)),
      'SNH'                  => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'SCL'                  => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'STR'                  => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'SNEWS_NOTE'           => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'NRAINFALL_MIDNIGHT'   => new sfValidatorNumber(array('required' => false)),
      'E401'                 => new sfValidatorNumber(array('required' => false)),
      'E402'                 => new sfValidatorNumber(array('required' => false)),
      'E403'                 => new sfValidatorNumber(array('required' => false)),
      'E404'                 => new sfValidatorNumber(array('required' => false)),
      'E405'                 => new sfValidatorNumber(array('required' => false)),
      'E406'                 => new sfValidatorNumber(array('required' => false)),
      'NNH'                  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'E42'                  => new sfValidatorNumber(array('required' => false)),
      'DTCREATE_TIME'        => new sfValidatorDateTime(array('required' => false)),
      'IUSER_ID'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SIPADDRESS'           => new sfValidatorString(array('max_length' => 15, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input3hour[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Input3hour';
  }


}
